import request from "@/utils/request";
// 提交订单
export const reqSubmitOrder = (hoscode, scheduleId, patientId) => {
  return request.post(
    "/order/orderInfo/auth/submitOrder/" +
      `${hoscode}/${scheduleId}/${patientId}`
  );
};
// 获取订单信息
export const reqOrderInfo = (id) => {
  return request.get("/order/orderInfo/auth/getOrderInfo/" + `${id}`);
};
// 取消订单
export const reqCancelOrder = (id) => {
  return request.get("/order/orderInfo/auth/cancelOrder/" + `${id}`);
};
// 获取支付二维码
export const reqGetQrcode = (orderId) => {
  return request.get("/order/weixin/createNative/" + orderId);
};
// 询问服务器用户的支付情况
export const reqPayResult = (orderId) => {
  return request.get("/order/weixin/queryPayStatus/" + orderId);
};
//获取当前账号的用户信息
export const reqGetUserInfo = () => {
  return request.get("/user/auth/getUserInfo");
};
// 获取证件类型
export const reqCertainType = (CertificatesType = "CertificatesType") => {
  return request.get("/cmn/dict/findByDictCode/" + CertificatesType);
};
// 用户认证
export const reqUserCertation = (data) => {
  return request.post("/user/auth/userAuah", data);
};
// 获取订单状态
export const reqOrderState = () => {
  return request.get("/order/orderInfo/auth/getStatusList");
};
// 获取订单详情
export const reqUserOrderInfo = (page, limit, patientId, orderStatus) => {
  return request.get(
    "/order/orderInfo/auth/" +
      `${page}/${limit}?patientId=${patientId}&orderStatus=${orderStatus}`
  );
};
//获取城市接口
export const reqCityInfo = (parentId) => {
  return request.get("/cmn/dict/findByParentId/" + parentId);
};
// 新增和修改用户接口
export const reqAddOrUpdateUser = (data) => {
  if (data.id) {
    return request.put("/user/patient/auth/update", data);
  } else {
    return request.post("/user/patient/auth/save", data);
  }
};
// 删除用户接口
export const reqDelUser = (id) => {
  return request.delete("/user/patient/auth/remove/" + id);
};
